home *** CD-ROM | disk | FTP | other *** search
/ 3D World 110 / 3DW_110.iso / mac / Menu / Scenes / home.dir / 00006_Script_Main Button Rollover < prev    next >
Text File  |  2008-09-12  |  4KB  |  164 lines

  1. global rollcolor
  2. global gFullPath
  3. global gRootPath
  4. global gDiv
  5. global finalChan
  6. global gMenuList
  7. global SectionPath
  8. global SectionNumber
  9. property Sp
  10. property myPath
  11. property myListEntry
  12. property myTitle
  13. property myToolTip
  14.  
  15. on Initialize me, aNumber, aAction, aListEntry, aItemTitle
  16.   Sp = sprite(aNumber)
  17.   myPath = aAction
  18.   myTitle = aItemTitle
  19.   myListEntry = aListEntry
  20.   myToolTip = ""
  21.   
  22.   case Mypath.char[1] of
  23.     "[":
  24.       myToolTip = "Click here to go online..."
  25.   end case
  26. end
  27.  
  28. on mouseEnter me
  29.   cursor 280
  30.   Sp.member = member("main_over", "GFX")
  31.   
  32.   if myTooltip <> "" then
  33.     member("tooltip_back").regpoint = point(0,0)
  34.     lc = _movie.channel.count
  35.     
  36.     tipLoc = Sp.loc + point(0,30)
  37.     
  38.     channel(lc-1).makescriptedsprite(member("tooltip_back"), tipLoc)
  39.     if myToolTip <> "" then
  40.       
  41.       member("tooltip_text").text = myTooltip
  42.     else
  43.       member("tooltip_text").text = "Click to go online..."
  44.     end if
  45.     
  46.     channel(lc).makescriptedsprite(member("tooltip_Text"), (tipLoc + point(5,1)))
  47.     sprite(lc).ink = 36
  48.     
  49.   end if
  50.   
  51. end
  52.  
  53. on mouseLeave me
  54.   sp.member = member("main_button", "gfx")
  55.   lc = _movie.channel.count
  56.   
  57.   channel(lc-1).removescriptedsprite()
  58.   channel(lc).removescriptedsprite()
  59.   
  60.   cursor -1
  61.   Sp.color = rgb(0,0,0)
  62.   
  63. end
  64.  
  65. on mouseUp me
  66.   repeat with i = finalchan to _movie.channel.count
  67.     channel(i).removescriptedsprite()
  68.   end repeat
  69.   if myPath.char[1] = "<" then
  70.     pMarker = myPath.char[2..(myPath.char.count - 1)]
  71.     go to marker (pMarker)
  72.   else if myPath.char[1] = "[" then
  73.     pURL = myPath.char[2..(myPath.char.count - 1)]
  74.     gotonetpage(pURL)
  75.   else if myPath.char[1] = "{" then
  76.     pMovieTarget = myPath.char[2..(myPath.char.count - 1)]
  77.     go to movie gRootPath & "menu" & gDiv & "Scenes" & gDiv & pMovieTarget
  78.   else if myPath.char[1] = "(" then
  79.     pLinkTarget = myPath.char[2..(myPath.char.count - 1)]
  80.     theLink = pathReplace(gRootPath & "DiscContent" & gDiv & pLinkTarget)
  81.     put theLink
  82.     gotonetpage("file:///" & theLink)
  83.   else if myPath contains "gallery" then
  84.     pMarker = "gallery"
  85.     SectionNumber = myListEntry
  86.     gFullpath = gRootPath & "DiscContent" & gDiv & gMenuList[myListEntry].itemPath & gDiv
  87.     go to marker(pMarker)
  88.   else
  89.     
  90.     grabDetails
  91.   end if
  92.   
  93. end
  94.  
  95. on pathReplace aPath
  96.   ret = ""
  97.   if the platform contains "mac" then
  98.     
  99.     repeat with i = 1 to aPath.char.count
  100.       if aPath.char[i] = ":" then
  101.         ret = ret & "/"
  102.       else
  103.         ret = ret & aPath.char[i]
  104.       end if
  105.     end repeat
  106.     return ret
  107.   else
  108.     ret = ret & gRootPath.char[1..2]
  109.     repeat with i = 3 to aPath.char.count
  110.       if aPath.char[i] = ":" then
  111.         ret = ret & "/"
  112.       else
  113.         ret = ret & aPath.char[i]
  114.       end if
  115.     end repeat
  116.     return ret
  117.   end if
  118. end
  119.  
  120.  
  121.  
  122. on grabDetails
  123.   member("SectionTitle").text = myTitle
  124.   pLine = 1
  125.   lH = 20
  126.   lV = 225
  127.   
  128.   SectionPath = gMenuList[myListEntry].itemPath
  129.   
  130.   SectionNumber = myListEntry
  131.   
  132.   if gMenuList[myListEntry].itemList.count > 0 then
  133.     
  134.     fullPath = gRootPath & "DiscContent" & gDiv & SectionPath & gDiv & (gMenuList[SectionNumber].itemList[1].itemPath) & gDiv
  135.     
  136.     gFullPath = fullPath
  137.     
  138.     
  139.     generateProductPage(fullPath)
  140.  
  141.     repeat with i = 1 to the number of members of castlib "SubItems"
  142.       if member(i, "subItems").name contains myTitle then
  143.         channel(finalChan + pLine).removescriptedsprite()
  144.         channel(finalChan + pLine).makescriptedsprite(member(i, "subItems"), point(lH,lV))
  145.         sprite(finalChan + pLine).scriptInstanceList = []
  146.         add(sprite(finalChan + pLine).scriptInstanceList, new(script "Sub_Item_Rollover", 1))    
  147.         _movie.sendSprite(finalChan + pLine, #Initialize, (finalChan + pLine), pLine)
  148.         sprite(finalChan + pLine).ink = 36
  149.         lV = lV + 25
  150.         pLine = pLine + 1
  151.       end if
  152.     end repeat
  153.     fullPath = gRootPath & "DiscContent" & gDiv & SectionPath & gDiv & (gMenuList[SectionNumber].itemList[1].itemPath) & gDiv
  154.     
  155.     gFullPath = fullPath
  156.     
  157.     go to marker("software")
  158.   end if
  159.   
  160. end
  161.  
  162.  
  163.  
  164.